<UserControl x:Class="Quixo3D.UI.MoveHistory"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	 xmlns:quixo="clr-namespace:Quixo3D.Framework;assembly=Quixo3D.Framework">

	<UserControl.Resources>
		<DataTemplate x:Key="itemDataTemplate">

			<Grid TextBlock.FontSize="12" Margin="3">
				<Grid.ColumnDefinitions>
					<ColumnDefinition Width="Auto" SharedSizeGroup="PlayerColumn"/>
					<ColumnDefinition Width="Auto" SharedSizeGroup="SourceColumn"/>
					<ColumnDefinition Width="Auto" SharedSizeGroup="DestColumn"/>
				</Grid.ColumnDefinitions>

				<TextBlock Grid.Column="0" Margin="10,0,10,0" Text="{Binding Path=PlayerText}"/>
				<TextBlock Grid.Column="1" Margin="10,0,10,0" Text="{Binding Path=Source}"/>
				<TextBlock Grid.Column="2" Margin="10,0,10,0" Text="{Binding Path=Destination}"/>
			</Grid>

		</DataTemplate>

		<ControlTemplate x:Key="Header" TargetType="{x:Type Button}">
			<Border TextBlock.FontSize="12" Padding="10,3,10,4">
				<ContentPresenter/>
			</Border>
		</ControlTemplate>
		<Style x:Key="multiColumnListBox" TargetType="ListBox">

			<Setter Property="Template">
				<Setter.Value>
					<ControlTemplate>
						<Grid Grid.IsSharedSizeScope="True" VerticalAlignment="Stretch" >
							<Grid.RowDefinitions>
								<RowDefinition Height="Auto"/>
								<RowDefinition Height="*"/>
							</Grid.RowDefinitions>
							<Border Grid.Row="1">
								<Border Margin="10">
									<DockPanel>
										<ScrollViewer DockPanel.Dock="Top" HorizontalScrollBarVisibility="Hidden">
											<Grid DockPanel.Dock="Top" Margin="0,0,18,0">
												<Grid.ColumnDefinitions>
													<ColumnDefinition Width="Auto" SharedSizeGroup="PlayerColumn"/>
													<ColumnDefinition Width="Auto" SharedSizeGroup="SourceColumns"/>
													<ColumnDefinition Width="Auto" SharedSizeGroup="DestColumn"/>
												</Grid.ColumnDefinitions>
												<Button Grid.Column="0" Template="{StaticResource Header}">Player</Button>
												<Button Grid.Column="1" Template="{StaticResource Header}" >Source</Button>
												<Button Grid.Column="2" Template="{StaticResource Header}">Destination</Button>
											</Grid>
										</ScrollViewer>
										<ScrollViewer HorizontalScrollBarVisibility="Hidden"  VerticalScrollBarVisibility="Visible"  Name="Master">
											<StackPanel IsItemsHost="True"/>
										</ScrollViewer>
									</DockPanel>
								</Border>
							</Border>
						</Grid>
					</ControlTemplate>
				</Setter.Value>
			</Setter>
		</Style>

	</UserControl.Resources>

	<ListBox x:Name="itemList" VerticalAlignment="Stretch" SelectedIndex="0" Style="{StaticResource multiColumnListBox}" ItemTemplate="{StaticResource itemDataTemplate}" />

</UserControl>
